<?php
use app\models\ActivityApply;
use app\models\Comment;
use app\widgets\CommentWidget;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this \yii\web\View */
/* @var $model \app\models\Job */

/* @var $isApply boolean */
/* @var $isFavorite boolean */
?>
<footer class="ui-footer ui-footer-btn">

    <ul class="ui-row-flex ui-footer-btn-group">
        <li class="ui-col ui-flex ui-flex-pack-center ui-flex-align-center">
            <button<?= $isApply ? ' disabled="disabled"' : ''; ?> title="报名" href="<?= Url::to(['apply', 'id' => $model->id]); ?>" class="btn ui-btn<?= !$user || !$isApply ? ' loginSubmit' : ''; ?> apply">我要报名
            </button>
        </li>
        <li class="ui-col ui-flex ui-flex-pack-center  ui-flex-align-center">
            <button title="收藏" href="<?= Url::to(['user/favorite', 'own_id' => $model->id, 'own' => ActivityApply::OWN_JOB]); ?>" class="btn ui-btn ui-btn-primary favorite"<?= $isFavorite ? ' disabled="disabled"' : ''; ?>>我要收藏
            </button>
        </li>
    </ul>
</footer>


<section class="ui-container">


    <div class="event-details p-m10">

        <div class="careerInfo">
            <div class="hd">
                <span class="fr red"><?= Html::encode($model->salary); ?></span>
                <strong><?= Html::encode($model->title); ?></strong>
            </div>
            <div class="bd">
                <p class="ui-txt-info">
                    <?= Html::encode($model->company); ?>
                </p>
                <p class="ui-txt-info ui-txt-sub">
                    <i class="iconfont">&#xe619;</i><?= Html::encode($model->city); ?>&nbsp;&nbsp;&nbsp;&nbsp;
                    <i class="iconfont">&#xe645;</i><?= Html::encode($model->job_type); ?>&nbsp;&nbsp;&nbsp;&nbsp;
                    <i class="iconfont">&#xe610;</i><?= Html::encode($model->work_time); ?>&nbsp;&nbsp;&nbsp;&nbsp;
                </p>
                <span class="time"><?= date('m-d', $model->ctime); ?></span>
            </div>
        </div>

        <h1>公司介绍</h1>
        <div class="p10">
            <h2>
                公司详情介绍：
            </h2>
            <p class="ui-txt-info">
                <?= nl2br(Html::encode($model->experience1)); ?>
            </p>

            <h2>
                公司风貌展示：
            </h2>
            <p class="ui-txt-info">
                <?= nl2br(Html::encode($model->experience2)); ?>
            </p>

            <h2>
                发展历程：
            </h2>
            <p class="ui-txt-info">
                <?= nl2br(Html::encode($model->experience3)); ?>
            </p>

        </div>


        <h1>
            职位描述
        </h1>
        <div class="p10">
            <h2>
                岗位职责：
            </h2>
            <p class="ui-txt-info">
                <?= nl2br(Html::encode($model->experience4)); ?>
            </p>

            <h2>
                任职要求：
            </h2>
            <p class="ui-txt-info">
                <?= nl2br(Html::encode($model->experience5)); ?>
            </p>
        </div>


        <h1>
            讨论区(<?= $model->comments; ?>）
        </h1>
        <div class="discussion-area">
            <div class="hd">
                <ul class="ui-list ui-list-text  ui-list-link">
                    <li class="ui-border-t">
                        <div class="ui-list-info">
                            <button data-href="<?= Url::to(['comment/save', 'own' => Comment::OWN_JOB, 'own_id' => $model->id, 'ref' => Url::to('', TRUE)]); ?>" type="button" class="uibtn">发表讨论</button>
                        </div>
                        <div class="ui-list-action" data-href="<?= Url::to(['comment/', 'own' => Comment::OWN_JOB, 'own_id' => $model->id]); ?>">查看更多</div>
                    </li>

                </ul>
            </div>
            <div class="bd">
                <?= CommentWidget::widget(['own_id' => $model->id, 'own' => Comment::OWN_JOB]); ?>
            </div>
        </div>
    </div>
</section>